﻿@using vITs.Site.Models.DataModels
@model vITs.Site.Models.ActionModels.UserDataModel
@{
    ViewBag.Title = "Skapa Ny Användare";
}
@using (this.Html.BeginForm())
{
    <fieldset>
        <legend>
            <h2>@this.ViewBag.Title</h2>
        </legend>
        @this.Html.ValidationSummary(true)
        <br />
        @this.Html.LabelFor(m => m.EmailAddress)
        <br />
        @this.Html.EditorFor(m => m.EmailAddress) @this.Html.ValidationMessageFor(m => m.EmailAddress)
        <br />
        @this.Html.LabelFor(m => m.Password)
        <br />
        @this.Html.EditorFor(m => m.Password) @this.Html.ValidationMessageFor(m => m.Password)
        <br />
        @this.Html.LabelFor(m => m.ConfirmPassword)
        <br />
        @this.Html.EditorFor(m => m.ConfirmPassword) @this.Html.ValidationMessageFor(m => m.ConfirmPassword)
        <br />
        @this.Html.LabelFor(m => m.GivenName)
        <br />
        @this.Html.EditorFor(m => m.GivenName) @this.Html.ValidationMessageFor(m => m.GivenName)
        <br />
        @this.Html.LabelFor(m => m.Surname)
        <br />
        @this.Html.EditorFor(m => m.Surname) @this.Html.ValidationMessageFor(m => m.Surname)
        <br />
        @{
            var roles = new VitsDB().Roles;
        }
        @foreach (var role in roles)
        {
            <input name="Roles" type="checkbox" value="@role.RoleId" id="Role-@role.RoleId" /> <label for="Role-@role.RoleId">@role.Name</label>
            <br />
        }
        <br />
        <input type="submit" value="Skapa" /> <input type="button" onclick="javascript:window.location='@this.Url.Action("Index")';" value="Tillbaka" />
    </fieldset>
}
